package cn.dlc.com.account.controller;

import cn.dlc.com.account.entity.Account;
import cn.dlc.com.account.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 邓立川
 * @date 2021/1/12 15:57
 * @desc 添加当前类的描述信息
 */
@RestController
@RequestMapping("bank1")
public class AccountController {

    @Autowired
    private AccountService accountService;

    @PostMapping("from")
    public String saveAll(@RequestBody Account account){
        try{
            if(account != null) {
                accountService.saveAll(account);
            }
            return "ok";
        } catch (Exception e) {
            e.printStackTrace();
            return "error";
        }
    }
}
